<?php
namespace app\serverfund\service\thirdpartyalipay;

use \app\manage\service\ApiBase;
/**
 * @author:      李颖
 * @DateTime:    2017-12-21 14:17:46
 * @Description: 杉奇无卡支付 支付宝支付
 */
class SqBankCard extends ApiBase
{

	protected $sqBankCardValidate = '\app\serverfund\validate\SqBankCard';
    protected $sqBankCardLogic = '\app\serverfund\logic\SqBankCard';

    /*杉奇无卡支付*/
    public function sqPayOrder(): array 
    {
        $data = $this->haveIssetReceiveData(['goods_name'=>' ', 'merch_order_no'=>0, 'phone_no'=>' ', 'customer_name'=>' ', 'cerd_id'=>' ', 'card_no'=>' ', 'cvn2'=>' ', 'valid_date'=>' ', 'amount'=>0]);
    	return $this->stepRun($data, 'sqPayOrder');
    }

    /*查询订单*/
    public function getOrderInfo(): array 
    {
        $data = $this->haveIssetReceiveData(['merchant_order_id'=>0]);
    	return $this->stepRun($data, 'getOrderInfo');
    }

    /*测异步回调*/
    public function sqReceivePayNotify()
    {
        $context = "respCode=00&settleDate=20171227&cardType=1&payTime=20171227145013&amount=1&acceptTime=20171227145013&payStatus=3&payType=NC01&respMsg=%E6%88%90%E5%8A%9F&res1=40C6B14CD39B7ACEE050007F01003D60&merchantNo=037290058120162&acceptOrderId=23b3463f93654d9ebb9c30709f9988f6&merchantOrderId=391";
        $res = logic('\app\serverfund\logic\SqBankCard')->sqReceivePayNotify($context);
        return auto_return($res);
    }

}